import { h,Component } from 'preact';
import classNames from 'classnames';
import { mapChild } from '../utils/util.obj';

const Item = ({ className,children: cd,...other }) => <li class={classNames('list-group-item',{ [`${className}`]: !!className })} {...other}>{cd}</li>;

class List extends Component {
	constructor(props) {
		super(props);
		this.state = {

		};
	}

	componentDidMount() {

	}

	render({ children,className, ...other },state) {
        

		return (
			<ul className={classNames('list-group',className)} {...other}>
				{mapChild(children,child => <Item {...child.props} />)}
			</ul>
		);
	}
}

List.Item = Item;

List.propTypes = {

};

export default List;
